<template>
	<view>
		<image src="/static/home/topbg.png" class="topbg" mode=""></image>
		<u-navbar left-icon=" " :autoBack="false" title="首页" bgColor="transparent"
			titleStyle="color:#1E1E1E;font-size:34rpx;fontWeight:800;" placeholder></u-navbar>
		<scroll-view scroll-y="true" class="scbox">
			<view class="con">
				<view class="prl30">
					<u-search placeholder="请输入关键词" color='#333' searchIconSize='50rpx' :showAction="false"
						bgColor='rgba(240, 240, 240, .5)' height='95rpx' placeholderColor='#8D8D8D'
						v-model="keyword"></u-search>
					<!-- 轮播 -->
					<view class="swiperbox">
						<u-swiper :list="list1" height='283rpx' radius='20rpx' circular interval='5000'></u-swiper>
					</view>
				</view>
				<!-- 栏目 -->
				<view class="prl30">
					<view class="title">
						<image src="/static/home/dkxx.png" class="title__icon" mode=""></image>
						贷款
					</view>
					<view class="dkbox">
						<image src="/static/home/dkbg.png" class="dkbox__bg" mode=""></image>
						<view class="dkbox__con">
							<view class="dkbox__con__title">
								信用/抵押贷款
							</view>
							<view class="dkbox__con__tip">
								最高可借(元)
							</view>
							<view class="dkbox__con__num">
								3,000,000
							</view>
							<view class="">
								<u-button shape='circle' color="#FFFAF7" text="去申请" @click="navto('/pages/examine/loanapplication')"
									:customStyle='{width:"126rpx",height:"53rpx",color:"#1547B7",fontSize:"21rpx",margin:"0"}'></u-button>
							</view>
						</view>
					</view>
					<view class="title">
						<image src="/static/home/zl.png" class="title__icon" mode=""></image>
						租赁
					</view>
					<view class="zlbox">
						<view class="zlbox__item" v-for="(item,index) in tablist" :key="index"
							@click="navto('/pages/lease/list?title='+item.name+'&type='+item.url)">
							<view class="zlbox__item__picbox">
								<image :src="'/static/home/'+item.icon+'.png'" :style="item.st" mode=""></image>
							</view>
							{{item.name}}
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<tabbar :current="0"></tabbar>
	</view>
</template>

<script>
	import home from '@/api/_home.js'
	export default {
		data() {
			return {
				keyword: '',
				list1: [],
				tablist: [{
						icon: 't1',
						st: 'width: 89rpx;height: 99rpx;margin: 19rpx 0 0 38rpx;',
						name: '手机租赁',
						url: '1'
					},
					{
						icon: 't2',
						st: 'width: 129rpx;height: 96rpx;margin: 29rpx 0 0 23rpx;',
						name: '家具租赁',
						url: '2'
					},
					{
						icon: 't3',
						st: 'width: 75rpx;height: 92rpx;margin: 22rpx 0 0 38rpx;',
						name: '家电租赁',
						url: '3'
					},
					{
						icon: 't4',
						st: 'width: 110rpx;height: 100rpx;margin: 18rpx 0 0 22rpx;',
						name: '其他租赁',
						url: '4'
					},
				]
			};
		},
		onLoad() {
			uni.hideTabBar()
			this.getindex()
		},
		methods:{
			async getindex(){
				let res = await home.index()
				if(res.data.code==1){
					res.data.data.banner.map(t=>{
						this.list1.push(this.URL(t))
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F0F0F0;
	}

	.topbg {
		width: 750rpx;
		height: 460rpx;
		position: fixed;
		top: 0;
		left: 0;
	}
	.scbox{
		height: calc(100vh - var(--status-bar-height) - 44px - 146rpx);
	}
	.con {
		padding: 20rpx 0 38rpx;
		position: relative;
	}

	::v-deep.u-search__content {
		padding: 0 30rpx !important;

		.u-search__content__input {
			background-color: transparent !important;
		}
	}

	.swiperbox {
		background: #E5E5E5;
		box-shadow: 0rpx 7rpx 18rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 20rpx;
		margin-top: 26rpx;
	}

	.title {
		display: flex;
		align-items: center;
		font-family: PingFang SC;
		font-weight: 800;
		font-size: 30rpx;
		color: #000207;
		line-height: 30rpx;
		margin-bottom: 28rpx;
		margin-top: 40rpx;

		&__icon {
			width: 33rpx;
			height: 33rpx;
			margin-right: 12rpx;
		}
	}

	.dkbox {
		height: 351rpx;
		position: relative;

		&__bg {
			width: 690rpx;
			height: 351rpx;
			position: absolute;
			top: 0;
			left: 0;
		}

		&__con {
			position: relative;
			padding: 44rpx 0 0 48rpx;

			&__title {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 28rpx;
				color: #FAF7F7;
				line-height: 28rpx;
				margin-bottom: 15rpx;
			}

			&__tip {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 21rpx;
				color: #FAF7F7;
				line-height: 21rpx;
				opacity: 0.57;
				margin-bottom: 34rpx;
			}

			&__num {
				font-family: DIN Next LT Pro;
				font-weight: bold;
				font-size: 48rpx;
				color: #FAF7F7;
				line-height: 38rpx;
				margin-bottom: 63rpx;
			}
		}
	}

	.zlbox {
		background: rgba(50, 98, 253, .2);
		border-radius: 20rpx;
		padding: 32rpx 32rpx 5rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;

		&__item {
			width: 300rpx;
			height: 134rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin-bottom: 22rpx;
			display: flex;
			align-items: center;
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 28rpx;
			color: #3A3434;

			&__picbox {
				width: 150rpx;
				height: 134rpx;
			}
		}
	}

	.prl30 {
		padding: 0 30rpx;
	}
</style>